﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.IO;

namespace SimpleData
{
	/// <summary>
	/// 
	/// </summary>
	public static class AssemblyResourceExtensions
	{

		public static TextReader OpenEmbeddedResource( this Runtime runtime, string resource )
		{
			return runtime.OpenEmbeddedResource( resource, Assembly.GetExecutingAssembly() );
		}

		public static TextReader OpenEmbeddedResource( this Runtime runtime, string resource, Assembly asm )
		{
			Stream file = asm.GetManifestResourceStream( resource );
			return new StreamReader( file );
		}
	}
}
